%%   Plot object distance versus relative camera angle.
%
clear;
s       =   20;             % Distance between both camera's in CM.
range   =   [-30, 30];      % Camera range in degrees.


%  Loop over all possible angles.
n           =   60;
dr          =   abs(range(1) - range(2)) / n;

x = [];
y = [];

for i = 1:n
    for j = 2:n-1
        if abs(i - j) < 3
            continue;
        end
        
        alpha           = range(1) + i * dr
        beta            = range(1) + j * dr
        distance(i, j) = (s * cos(alpha)) / (cos(90 - alpha - beta));
        x               = [x, i];
        y               = [y, j];
    end
end

mesh(distance);